package cn.ilovese.collect.controller.user;

import cn.ilovese.collect.service.user.MessageService;
import cn.ilovese.collect.vo.NullVO;
import cn.ilovese.collect.vo.ResultVO;
import cn.ilovese.collect.vo.task.TaskWithUsernameVO;
import cn.ilovese.collect.vo.workermessage.WorkerMessageVO;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/message")
public class MessageController {
    @Resource
    MessageService messageService;

    @GetMapping("/allmessage/{workerid}")
    ResultVO<List<WorkerMessageVO>> getMyMessage(@PathVariable Integer workerid){
        return messageService.getMyMessage(workerid);
    }

    @GetMapping("/setRead/{messageId}")
    ResultVO<String> setRead(@PathVariable Integer messageId, @RequestParam Integer uid){
        return messageService.setRead(messageId,uid);
    }
}
